
var express = require('express');
var router = express.Router();
var bodyParser = require('body-parser');




module.exports = function(app){
    router.post("/preview",bodyParser.json(),function(req,res){
        var html = req.body.innerHtml
        router.get("/"+req.body.uuid,function(req,res){
            res.send(html)
        })
        app.use("/preview",router)
        res.send({
            url:"/preview/"+req.body.uuid,
        })
    })

    app.use("/v1",router)

}